package com.chen.demo.wechat.dao;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.chen.demo.wechat.domain.User;

@Mapper
public interface UserMapper {

	@Select({"select * from user where id = #{id}"})
	User findById(@Param("id") int id);
	//这里可以使用注释的方式或者是xml的方式都行。
	List<User> findAll();
	@Insert({"insert into user (name,age) values(#{name},#{age}"})
	void saveUser(@Param("name") String name, @Param("age") int age);
}
